Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Linux Consumption Function Apps #7230

Merged

Conversation

borancar
Copy link
Contributor

@borancar borancar commented Jun 5, 2020

Do not add WEBSITE_CONTENTSHARE and
WEBSITE_CONTENTAZUREFILECONNECTIONSTRING automatically nor ignore it
when comparing resources for Linux Consumption Function Apps. According
to a bug report they should not be there for Linux
Azure/azure-functions-python-worker#598.

Fixes #5209

Do not add WEBSITE_CONTENTSHARE and
WEBSITE_CONTENTAZUREFILECONNECTIONSTRING automatically nor ignore it
when comparing resources for Linux Consumption Function Apps. According
to a bug report they should not be there for Linux
Azure/azure-functions-python-worker#598.

Fixes #5209
@ghost ghost added the size/XS label Jun 5, 2020
@jackofallops jackofallops self-assigned this Jun 5, 2020
Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @borancar for this, LGTM 👍

@jackofallops
Copy link
Member

Tests Pass:
image
(One failure, unrelated to this change.)

@jackofallops jackofallops added this to the v2.14.0 milestone Jun 5, 2020
@jackofallops jackofallops merged commit 89529b3 into hashicorp:master Jun 5, 2020
jackofallops added a commit that referenced this pull request Jun 5, 2020
@borancar borancar deleted the fix/linux_consumption_function_app branch June 5, 2020 21:09
@ghost
Copy link

ghost commented Jun 11, 2020

This has been released in version 2.14.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.14.0"
}
# ... other configuration ...

@TSPereira
Copy link

Hi,
I have tried using version 2.14.0 to use this fix and I get an odd issue.

I have two azure functions being published in the same stage using

publish:
  stage: publish
  script:
    - cd crawler_func; zip -r ../crawler.zip *
    - func azure functionapp publish <func1_name> --build remote
    - cd ..
    - cd extractor_func; zip -r ../extractor.zip *
    - func azure functionapp publish <func2_name> --build remote
    - cd ..

And although I can see in the trace the properties being deleted when the azure function starts to be published for some reason it seems to work for function 1 but not for function 2.
On function 2 eventually it gets a 404 (NotFound) error at different points.

I reverted back to my previous solution (I have a cleanup stage before publishing the functions just to delete these properties as below and provider version = 1.44.0) and everything works fine in it

cleanup:
  stage: cleanup
  script:
    - >
      az functionapp config appsettings delete
      --resource-group <resource_group_name_func1>
      --name <func1_name>
      --setting-names {"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING","WEBSITE_CONTENTSHARE"}
    - >
      az functionapp config appsettings delete
      --resource-group <resource_group_name_func2>
      --name <func2_name>
      --setting-names {"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING","WEBSITE_CONTENTSHARE"}

It is weird cause it works fine for the first function but not for the second. And it is not function related as I have tried to revert their order and it still works for the function that comes first and still breaks on 2nd one.
By the way, functions are deployed in separate resource groups

@ghost
Copy link

ghost commented Jul 6, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Jul 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linux consumption plan apps created using terraform return 503 because of WEBSITE_CONTENT* settings
3 participants